﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["RMSConnection"].ConnectionString);
    protected void Page_Load(object sender, EventArgs e)
    {
        Load_Data();
    }
    public void Load_Data()
    {
        String s;
        s = Request.QueryString["ID"];
        
        int id = int.Parse(s);
        DataTable dt = new DataTable();
        String sql = String.Format(@"SELECT * FROM Documents WHERE ID = {0}", id);
        SqlCommand cmd = new SqlCommand(sql, con);
        con.Open();
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        da.SelectCommand = cmd;
        da.Fill(dt);
        listView1.DataSource = dt;
        listView1.DataBind();
        con.Close();
    }
}
